package com.cms.chris.service;

import com.cms.chris.dao.ColumnDAO;
import com.cms.chris.entity.po.ColumnPO;
import com.common.chris.util.SnowflakeIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ColumnService {

    @Autowired
    private ColumnDAO columnDAO;

    @Transactional(rollbackFor = Exception.class)
    public Integer add() {
        long l = SnowflakeIdWorker.nextId();
        ColumnPO columnPO = new ColumnPO();
        columnPO.setColumnId(l);
        columnPO.setColumnName("哈哈");
        int insert = columnDAO.insert(columnPO);
        return insert;
    }

}
